#	$OpenBSD: Makefile.bsd-wrapper,v 1.14 2014/08/22 19:28:25 brad Exp $

.include <bsd.own.mk>

XCFLAGS=	CC="${CC}" CFLAGS="${CFLAGS} ${COPTS}" LDFLAGS="${LDFLAGS}"
CONFIGURE_OPTS=	--prefix=/usr \
		--localstatedir=/var \
		--sysconfdir=/etc \
		--disable-shared \
		--disable-threads \
		--disable-openssl-version-check

PROG=	bin/dig/dig \
	bin/dig/host \
	bin/dig/nslookup

MAN=	bin/dig/dig.1 \
	bin/dig/host.1 \
	bin/dig/nslookup.1

BINDIR=		/usr/sbin


all:	config.status
	${MAKE}

.FORCE: .IGNORE

config: .FORCE
	-rm -f config.cache
	PATH="/bin:/usr/bin:/sbin:/usr/sbin" \
	${XCFLAGS} \
	INSTALL_PROGRAM="${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP}" \
	sh ${.CURDIR}/configure ${CONFIGURE_OPTS}

config.status:
	PATH="/bin:/usr/bin:/sbin:/usr/sbin" \
	${XCFLAGS} \
	INSTALL_PROGRAM="${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP}" \
	sh ${.CURDIR}/configure ${CONFIGURE_OPTS}

.ifdef NOMAN
maninstall:
	@echo NOMAN is set
.endif

install: maninstall
.for file in ${PROG}
	${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP} \
	-o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
	${file} ${DESTDIR}${BINDIR}
.endfor

BEFOREMAN= config.status

clean cleandir:
	-@if [ -e Makefile ]; then ${MAKE} distclean; fi
	rm -f ${CLEANFILES}

depend:
	# Nothing here so far...

lint:
	# Nothing here so far...

tags:
	# Nothing here so far...

.include <bsd.obj.mk>
.include <bsd.subdir.mk>
.ifndef NOMAN
.include <bsd.man.mk>
.endif
